/*
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2025-06-22 10:04:26
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-26 11:20:47
 * @FilePath: \shangyitong\src\api\hosptial\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEenum 
 * 
 */
import service from "@/utils/request";
import type { HospitalDetailResponseData,
     DeparmentResponseData ,
     userCodeResponse,
     HospitalWorkDataResponse,
     DoctorResponseData,
     VisitorResponseData,
     DocrorInfoData
    } from './type'
enum API {
    //获取医院详情
    HOSPITALDETAIL_URL = "/hosp/hospital",
    //获取某一个医院的科室的数据
    HOSPITALDEPARMENT_URL = '/hosp/hospital/department/',///hosp/hospital/department/hoscode
    //获取验证码接口
    GETUSERCODE_URL="/sms/send/",///api/sms/send/{phone}
    //获取某一个医院某一个科室预约挂号的情况
    HOSPITALWORK_URL = "/hosp/hospital/auth/getBookingScheduleRule/",//{{pages}}/{{limit}}//{{hoscode}}/{{depcode}}
    //获取医院某一科室某一医生排班,票号情况
    HOSPITALDOCTOR_URL = "/hosp/hospital/auth/findScheduleList/",//{hoscode}/{depcode}/{workDate}
    // 获取某一个账号下就诊人的信息
    GETUSER_UEL="/user/patient/auth/findAll",
    //获取就诊人选择的医生信息
    GETDOCTOR_URL="/hosp/hospital/getSchedule/",//{scheduleld}
    
}
//获取医院详情的方法
export const reqHospitalDetail = (hoscode: number | string) => service.get<any, HospitalDetailResponseData>(API.HOSPITALDETAIL_URL + `/${hoscode}`)
//获取医院科室的接口
export const reqHospitalDeparment = (hoscode: string) => service.get<any, DeparmentResponseData>(API.HOSPITALDEPARMENT_URL + hoscode);
//获取验证码接口方法
export const reqUserCode = (phone:string) => service.get<any, userCodeResponse>(API.GETUSERCODE_URL+ phone);

//获取某一个医院某一个科室预约挂号的方法
export const reqHospitalWork = (pages:number,limit:number,hoscode:string,depcode:string)=>service.get<any,HospitalWorkDataResponse>(API.HOSPITALWORK_URL+`${pages}/${limit}/${hoscode}/${depcode}`)

 //获取医院某一科室某一医生排班,票号情况
 export const reqHospitalDoctor = (hoscode:string,depcode:string,workDate:string)=>service.get<any,DoctorResponseData>(API.HOSPITALDOCTOR_URL+`${hoscode}/${depcode}/${workDate}`)

 //获取某一个账号下就诊人的信息
 export const reqGetUser = ()=>service.get<any,VisitorResponseData>(API.GETUSER_UEL)
 //获取就诊人选择的挂号医生信息
 export const reqGetDoctorInfo = (scheduleld:string)=>service.get<any,DocrorInfoData>(API.GETDOCTOR_URL +`${scheduleld}`)